package com.lkd.shoppingcart.entity;

import java.math.BigDecimal;
import java.util.Date;

/**
 * 订单视图
 * @author shubing
 *
 */
public class OrdersView {
	
	private String id;
	private int userId;
	private BigDecimal totalPrice;
	private int status;
	private Date crtTime;	
	
	public OrdersView() {
		super();
	}

	public OrdersView(String id, int userId, BigDecimal totalPrice, int status, Date crtTime) {
		super();
		this.id = id;
		this.userId = userId;
		this.totalPrice = totalPrice;
		this.status = status;
		this.crtTime = crtTime;
	}

	public String getId() {
		return id;
	}

	public void setId(String id) {
		this.id = id;
	}

	public int getUserId() {
		return userId;
	}

	public void setUserId(int userId) {
		this.userId = userId;
	}

	public BigDecimal getTotalPrice() {
		return totalPrice;
	}

	public void setTotalPrice(BigDecimal totalPrice) {
		this.totalPrice = totalPrice;
	}

	public int getStatus() {
		return status;
	}

	public void setStatus(int status) {
		this.status = status;
	}

	public Date getCrtTime() {
		return crtTime;
	}

	public void setCrtTime(Date crtTime) {
		this.crtTime = crtTime;
	}
	
	/**
	 * 获取订单状态的文字信息
	 * @return 返回订单状态的文字信息(0: "未发货"，1: "已发货"，2: "已完成")
	 */
	public String getStatusContent() {
		switch(status) {
		case 0:
			return "未发货";
		case 1:
			return "已发货";
		case 2:
			return "已完成";
		default:
			return null;
		}
	}

}
